//
//  ChatTableViewOtherTextCell.swift
//  IMUIDemo
//
//  Created by tbbMacmini on 2025/3/22.
//

import UIKit

class ChatTableViewOtherTextCell: UITableViewCell {

    
    lazy var avatarImageView:UIImageView = {
        let imageView = UIImageView();
        imageView.backgroundColor = UIColor.lightGray
        imageView.layer.cornerRadius = 10
        imageView.layer.masksToBounds = true
        return imageView
    }()
    
    lazy var contentLable: UILabel = {
        let lb = UILabel();
        lb.text = "_"
        lb.numberOfLines = 0
        lb.textAlignment = .right;
        return lb
    }()
    
    lazy var bgView: UIView = {
        let bgView = UIView()
        bgView.layer.cornerRadius = 10
        bgView.layer.masksToBounds = true
        bgView.backgroundColor = UIColor.yellow
        return bgView
    }()

    override func layoutSubviews() {
        super.layoutSubviews();
        setupView()
        
    }
    
    private func setupView() {
        contentView.addSubview(avatarImageView)
        avatarImageView.snp.makeConstraints { make in
            make.top.equalTo(10);
            make.left.equalTo(10)
            make.size.equalTo(CGSize(width: 44, height: 44));
        }
        
        contentView.addSubview(bgView)
        bgView.snp.makeConstraints { make in
            make.right.lessThanOrEqualTo(-60)
            make.left.equalTo(avatarImageView.snp.right).offset(10)
            make.top.equalTo(10);
            make.bottom.equalTo(-10)
        }
        
        bgView.addSubview(contentLable);
        contentLable.snp.makeConstraints { make in
            make.edges.equalToSuperview().inset(12)
        }
        
    }
    
}
